﻿using MediatR;
using T.Personnel.Domain;
using T.Personnel.Domain.Dto;
using T.Personnel.Read.API.Application.Command.ManageCommand;
using T.Personnel.Repository.Interface;

namespace T.Personnel.Read.API.Application.CommandHandler.ManageHandler
{
    public class GetListEntryManageHandler : IRequestHandler<GetListEntryManageCommand, Result<Manage>>
    {
        private readonly IManageRepository manage;

        public GetListEntryManageHandler(IManageRepository manage)
        {
            this.manage = manage;
        }

        public async Task<Result<Manage>> Handle(GetListEntryManageCommand request, CancellationToken cancellationToken)
        {
            return await manage.GetEntryAsync(request.Name,request.DepartmentId,request.PositionId,request.Hiredate,request.CreatedDate,request.AppStatus,request.PageIndex,request.PageSize);
        }
    }
}
